// 引入 request 方法，假设 request 方法已经定义在某个工具文件中
import request from '/@/utils/request';
import { AddOpenAccessInput, DeleteOpenAccessInput, GenerateSignatureInput, OpenAccessInput, UpdateOpenAccessInput } from '../models';
// 定义 API 路径枚举
enum Api {
    SysOpenAccessAdd = '/sysOpenAccess/add',
    SysOpenAccessDelete = '/sysOpenAccess/delete',
    SysOpenAccessGenerateSignature = '/sysOpenAccess/generateSignature',
    SysOpenAccessPage = '/sysOpenAccess/page',
    SysOpenAccessSecret = '/sysOpenAccess/secret',
    SysOpenAccessUpdate = '/sysOpenAccess/update',
}

// 定义 API 方法
export const apiSysOpenAccessAddPost = (body?: AddOpenAccessInput) =>
    request({
        url: Api.SysOpenAccessAdd,
        method: 'post',
        data: body,
    });

export const apiSysOpenAccessDeletePost = (body?: DeleteOpenAccessInput) =>
    request({
        url: Api.SysOpenAccessDelete,
        method: 'post',
        data: body,
    });

export const apiSysOpenAccessGenerateSignaturePost = (body?: GenerateSignatureInput) =>
    request({
        url: Api.SysOpenAccessGenerateSignature,
        method: 'post',
        data: body,
    });

export const apiSysOpenAccessPagePost = (body?: OpenAccessInput) =>
    request({
        url: Api.SysOpenAccessPage,
        method: 'post',
        data: body,
    });

export const apiSysOpenAccessSecretPost = () =>
    request({
        url: Api.SysOpenAccessSecret,
        method: 'post',
    });

export const apiSysOpenAccessUpdatePost = (body?: UpdateOpenAccessInput) =>
    request({
        url: Api.SysOpenAccessUpdate,
        method: 'post',
        data: body,
    });